package clustering;

public class Ngram_Profile {
	private String ngram;
	private int index;
	private int term_freq;
	private int doc_freq;
	private double tf_idf;
	public Ngram_Profile(String gram){
		ngram = gram;
		term_freq = 1;
		doc_freq = 1;
	}
	public String getNgram() {
		return ngram;
	}
	public void setNgram(String ngram) {
		this.ngram = ngram;
	}
	public int getIndex() {
		return index;
	}
	public void setIndex(int index) {
		this.index = index;
	}
	public int getTerm_freq() {
		return term_freq;
	}
	public void Increase_Termfreq(){
		term_freq ++;
	}
	
	public void setTerm_freq(int term_freq) {
		this.term_freq = term_freq;
	}
	public int getDoc_freq() {
		return doc_freq;
	}
	public void setDoc_freq(int doc_freq) {
		this.doc_freq = doc_freq;
	}
	public double getTf_idf() {
		return tf_idf;
	}
	public void setTf_idf(int size) {
		if(size<doc_freq)
			System.out.println("document frequency cannot be larger than the number of documents!");
		tf_idf = term_freq * Math.log((double)size/((double)doc_freq));
	}
	
}
